///////////////////////////////////////////////////////////////////////
// DFileSystemImageEvent.h
//
// Wrapper for DDiscFormat2EraseEvents Interface Events
//
// Written by Nic Wilson
//

#pragma once

class CDFileSystemImage;

// CDFileSystemImageEvent command target

class CDFileSystemImageEvent : public CCmdTarget
{
	DECLARE_DYNAMIC(CDFileSystemImageEvent)
private:
	LPTYPEINFO  m_ptinfo;           // ITest type information
	DWORD		m_dwCookie;
	LPUNKNOWN	m_pUnkSink;
	LPUNKNOWN	m_pUnkSrc;

	HWND		m_hNotifyWnd;

public:
	CDFileSystemImageEvent();
	virtual ~CDFileSystemImageEvent();

	static CDFileSystemImageEvent* CreateEventSink();

	bool ConnectDFileSystemImage(CDFileSystemImage*);
	inline void SetHwnd(HWND hWnd){m_hNotifyWnd = hWnd;}

	DECLARE_INTERFACE_MAP()

	BEGIN_INTERFACE_PART(FileSystemImageEvents, DFileSystemImageEvents)
		//
		// IDispatch Methods
		//
		STDMETHOD(GetTypeInfoCount)(UINT FAR* pctinfo);
		STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
		STDMETHOD(GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames,UINT cNames, LCID lcid, DISPID FAR* rgdispid);
		STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid, LCID lcid,WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult,EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr);
		//
		//virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Update( 
        //    /* [in] */ __RPC__in_opt IDispatch *object,
        //    /* [in] */ __RPC__in BSTR currentFile,
        //    /* [in] */ LONG copiedSectors,
        //    /* [in] */ LONG totalSectors) = 0;
		STDMETHOD_(HRESULT, Update)(LPDISPATCH, BSTR currentFile, LONG copiedSectors, LONG totalSectors);
	END_INTERFACE_PART(FileSystemImageEvents)

protected:
	DECLARE_MESSAGE_MAP()
};


